<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
<link rel="shortcut icon" href="images/zk.ico" type="image/x-icon" />
<link rel="stylesheet" href="lib/layui/css/layui.css">
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<style type="text/css">
	#search{
		
	}
	#seaInput{
		height: 30px;
	}
</style>
</head>
<body>
	<h4>部门 展示 页面</h4>
	
	<table class="table">
		<tr>
			<td>序号</td> 
			<td>部门名</td>
			<td>状态</td>
			<td><form action="addDept.do">请输入要添加的部门名称:<input type="text"  name="dename" minlength="2" maxlength="8"/>
		<input type="submit" value="添加部门"></form></td>
		</tr>
		<c:forEach items="${list}" var="l" varStatus="status">
			<tr>
				<td>${status.count}</td>
				<td>${l.dename}</td>
				<td><c:if test="${l.destate==2}">禁用</c:if>
				    <c:if test="${l.destate==1}">启用</c:if>
				<td><a href="deidChaDapt?deid=${l.deid}" ><button type="button" class="btn btn-info">修改</button></a> &nbsp;&nbsp;&nbsp;<a href="delUpdateDept?deid=${l.deid}" ><button type="button" class="btn btn-danger">删除</button></a></td>
				
			</tr>
		</c:forEach>
 				
	</table>
	<!-- 分页 页码 搜索分页  来回 传 name -->
	<%-- drname:::
	<br><span>${drname }</span>:::: --%>
	<nav aria-label="Page navigation">
	<ul class="pagination" style="margin-left:250px">
			<!-- 首页 -->
			<c:if test="${curr_no > start }">
			<li><a href="searchDrug.do?pageNo=1&drname=${drname }"> <span
					>首页</span></a>
			</li>
			</c:if>
			<!-- 点击  翻 5页 -->
			<c:if test="${sum > 5 && curr_no - 5  > start }">

			<li><a href="searchDrug.do?isSco=-1&start=${start }&end=${end}"
				aria-label="Previous"> <span aria-hidden="true">&laquo;</span></a>
			</li>
			</c:if>
			<!-- 上一页 -->
			<c:if test="${curr_no > 1 }">
			<li><a href="searchDrug.do?pageNo=${curr_no - 1 }&drname=${drname }" aria-label="Previous"> <span
					aria-hidden="true">上一页</span>
			</a></li>
			</c:if>
			
			<!-- 当选中某个页码 时  不能 点击当前     页码 -->
			<c:forEach items="${page }" var="no">
				<c:if test="${curr_no == no }">
					<li class="active"><a href="javascript:void(0);">${no }</a></li>
				</c:if>
				<c:if test="${curr_no != no }">
					<li><a href="searchDrug.do?pageNo=${no }&drname=${drname }">${no }</a></li>
				</c:if>
			</c:forEach>
			<!-- 点击  翻 5页 -->
			<c:if test="${ sum > 5 && curr_no + 5  < num }">
			<li><a href="searchDrug.do?isSco=1&start=${start }&end=${end}"
				aria-label="Next"> <span aria-hidden="true">&raquo;</span></a>
			</li>
			</c:if>
			
			<c:if test="${curr_no < sum }">
			<!-- 尾页 -->
			<li><a href="searchDrug.do?pageNo=${sum }&drname=${drname }"
				aria-label="Previous"> <span aria-hidden="true">尾页</span></a>
			</li>
			</c:if>
			<!-- 下一页  curr_no + 1 -->
			<c:if test="${curr_no < sum }">
				<li><a href="searchDrug.do?pageNo=${curr_no + 1 }&drname=${drname }" aria-label="Previous"> <span
						aria-hidden="true">下一页</span>
				</a></li>
			</c:if>
		</ul>
		</nav>
</body>
</html>